<?php 

$reqCat = mysql_query('Select * from categories'); 

?>

<div id="contentMenu"><br />

<?php 
	while($resCat = mysql_fetch_array($reqCat))
		{
			// On compte le nombre d'article par categorie
			$reqCompteArt = mysql_query('Select * from article where  CAT_ART = '.$resCat['NUM_CAT'].'');
			if (mysql_num_rows($reqCompteArt) > 0)
				{
					$nbArt=mysql_num_rows($reqCompteArt);
				}else
				{
					$nbArt = 0;
				}
				
				echo '<a href="detailCat.php?id='.$resCat['NUM_CAT'].'">'.$resCat['NOM_CAT'].' ('.$nbArt.')</a><br>';
		}


?>
	</ul>
</div><br />